
# 方法2，自己创建一个train.py文件:
from ultralytics import YOLO


# model = YOLO('yolov8s.yaml')  # 或.pt


model = YOLO('prune.pt')  # 第二步剪枝后得到的prune.pt路径

# model.train(data='mydata.yaml', epochs=100, amp=True)  # 微调可以打开amp


model.train(data='/mnt/gluster/home/huzheng/projects/2023_NP/trainingCode/yolov7-main/data/person.yaml', epochs=100, amp=True,project="./runs/persons_pre_prun", device='0,1,2,3',batch=160)